﻿using System.Data.Entity;
using System.Linq;
using CH.FourBoards.LagerWalti.Persistence.Entities;

namespace CH.FourBoards.LagerWalti.Persistence.DataAccess.EntityProviders
{
    internal class TransactionProvider : EntityProvider<Transaction>
    {
        public TransactionProvider(DataContext context)
            : base(context)
        {
        }

        protected override DbSet<Transaction> Set
        {
            get { return Context.Transactions; }
        }

        protected override IQueryable<Transaction> SetEagerlyLoaded
        {
            get { return Context.Transactions.Include(t => t.Product.Category).Include(t => t.Type); }
        }
    }
}
